package de.schall.rest.di;

import java.io.Serializable;
import java.util.Date;

import javax.enterprise.context.ApplicationScoped;

@ApplicationScoped
public class Human implements Serializable {
	
	private String firstName;
	private Date birthdate;
	private String surename;
	private String birthplace;

	public Human(String firstName, String surename, Date birthdate,
			String birthplace) {
		this.firstName = firstName;
		this.surename = surename;
		this.birthdate = birthdate;
		this.birthplace = birthplace;
	}
	
	public String firstName() {
		return firstName;
	}
	
	public Date birthdate() {
		return birthdate;
	}
	
	public String surename() {
		return surename;
	}
	
	public String birthplace() {
		return birthplace;
	}
	
	@Override
	public String toString() {
		StringBuffer buffer = new StringBuffer();
		buffer.append(firstName());
		buffer.append("\n");
		buffer.append(surename());
		buffer.append("\n");
		buffer.append(birthplace());
		buffer.append("\n");
		buffer.append(birthdate());
		
		return buffer.toString();
	}

	// Do not use!
	public Human() {
		this(((Double)Math.random()).toString(), "bla", new Date(), "Bla");
	}
}
